package com.inforich.app.api.controller.tourist;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.inforich.common.core.domain.AjaxResult;
import com.inforich.tourist.domain.Carousel;
import com.inforich.tourist.service.ICarouselService;
import com.inforich.tourist.service.ICommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: some desc
 * @author: HJM
 * @date: 2022/11/13
 */
@RestController
@RequestMapping("/h5api/carousel")
public class AppCarouselController {

  @Autowired
  private ICarouselService carouselService;

  /**
   * 产品列表
   */
  @GetMapping("/all")
  public AjaxResult all() {
    return AjaxResult.success(carouselService.list(
        new LambdaQueryWrapper<Carousel>().eq(Carousel::getState, "1")
            .orderByAsc(Carousel::getSortIndex)));
  }

}
